package com.qzimp.fujiancuo.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.qzimp.fujiancuo.entity.Tourist;
import com.qzimp.fujiancuo.mapper.TouristMapper;
import com.qzimp.fujiancuo.service.TouristService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author 吴宗波
 * @since 2024-11-21
 */
@Service
public class TouristServiceImpl extends ServiceImpl<TouristMapper, Tourist> implements TouristService {

    @Autowired
    private TouristMapper touristMapper;

    public Tourist getTouristWithOtherTable(Integer id) {
        List<Tourist> tourists = touristMapper.selectTouristWithOtherTable(id);
        if (tourists.size() > 0) {
            return tourists.get(0);
        }
        return null;
    }
}
